const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const { VueLoaderPlugin } = require('vue-loader')

module.exports = {
	devServer: {
		// contentBase: path.join(__dirname, 'dist'),
		// static: './public',
		port: 9000,
	},
	entry: './src/index.js',
	output: {
		filename: 'bundle.js',
		path: path.resolve(__dirname, 'dist'),
	},
	module: {
		rules: [
			// ... 其它规则
			{
				test: /\.vue$/,
				loader: 'vue-loader',
                options: {
                    hotReload: true // 关闭热重载
                  }
			},
		],
	},

	plugins: [
		// 请确保引入这个插件！
		new VueLoaderPlugin(),
		new HtmlWebpackPlugin({
			filename: 'index.html',
			template: __dirname + '/public/index.html',
		}),
	],
}
